package com.dongnam.quanly.common.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dongnam.quanly.common.model.enumtype.TrangThaiTonKho;

@Entity
@Table(name = "TonKho")
public class TonKho extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "SerialNumber", length = 32)
	private String serialNumber;

	@Column(name = "GiaSanPham")
	private Double giaSanPham;

	@Column(name = "Khohang")
	private String khoHang;

	@Column(name = "VatTuHangHoa")
	private String vatTuHangHoa;
	@Column(name = "ProductName", length = 200)
	private String productName;
	@Column(name = "DienGiai", length = 255)
	private String dienGiai;

	@Column(name = "TrangThai")
	@Enumerated(EnumType.STRING)
	private TrangThaiTonKho trangThai;

	@Column(name = "PhieuNhapKho")
	private String phieuNhapKho;

	@Column(name = "PhieuXuatKho")
	private String phieuXuatKho;

	@Column(name = "dangsudung")
	private boolean lock;

	@Column(name = "SoLuong")
	private Integer soLuong;

	public TonKho() {
		// TODO Auto-generated constructor stub
	}

	public boolean isLock() {
		return lock;
	}

	public void setLock(boolean lock) {
		this.lock = lock;
	}

	public String getKhoHang() {
		return khoHang;
	}

	public void setKhoHang(String khoHang) {
		this.khoHang = khoHang;
	}

	public String getVatTuHangHoa() {
		return vatTuHangHoa;
	}

	public void setVatTuHangHoa(String vatTuHangHoa) {
		this.vatTuHangHoa = vatTuHangHoa;
	}

	public String getSerialNumber() {
		return serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public Double getGiaSanPham() {
		return giaSanPham;
	}

	public void setGiaSanPham(Double giaSanPham) {
		this.giaSanPham = giaSanPham;
	}

	public TrangThaiTonKho getTrangThai() {
		return trangThai;
	}

	public void setTrangThai(TrangThaiTonKho trangThai) {
		this.trangThai = trangThai;
	}

	public String getDienGiai() {
		return dienGiai;
	}

	public void setDienGiai(String dienGiai) {
		this.dienGiai = dienGiai;
	}

	public String getPhieuNhapKho() {
		return phieuNhapKho;
	}

	public void setPhieuNhapKho(String phieuNhapKho) {
		this.phieuNhapKho = phieuNhapKho;
	}

	public String getPhieuXuatKho() {
		return phieuXuatKho;
	}

	public void setPhieuXuatKho(String phieuXuatKho) {
		this.phieuXuatKho = phieuXuatKho;
	}

	public Integer getSoLuong() {
		return soLuong;
	}

	public void setSoLuong(Integer soLuong) {
		this.soLuong = soLuong;
	}

	public void fillTonKho(TonKho tonKho) {
		this.giaSanPham = tonKho.giaSanPham;
		this.trangThai = tonKho.trangThai;
		this.khoHang = tonKho.khoHang;
		this.productName = tonKho.productName;
		this.serialNumber = tonKho.serialNumber;
		this.vatTuHangHoa = tonKho.vatTuHangHoa;
		this.phieuNhapKho = tonKho.phieuNhapKho;
		this.phieuXuatKho = tonKho.phieuXuatKho;
		this.dienGiai = tonKho.dienGiai;

	}

	public TonKho(TonKho tk) {
		super();
		this.giaSanPham = tk.giaSanPham;
		this.khoHang = tk.khoHang;
		this.vatTuHangHoa = tk.vatTuHangHoa;
		this.serialNumber = tk.serialNumber;
		this.productName = tk.productName;
		this.dienGiai = tk.dienGiai;
		this.trangThai = tk.trangThai;
		this.phieuNhapKho = tk.phieuNhapKho;
		this.phieuXuatKho = tk.phieuXuatKho;
	}

}
